<form action="<?php echo $config['url'] ?>controllers/write.php?tag=<?php echo $tag ?>" method="post">
  Parent: 
  <select name="tag_parent" onchange="document.parent.submit()">
    <option>none</option>
    <?php
    $tags = sqlite_fetch_all(sqlite_query($db,"SELECT name FROM tags"));
    foreach($tags as $tag) {
      $tagname = $tag['name'];
      echo "<option>$tagname</option>\n";
    }
    ?>
  </select>
  <input type="submit" value="save &raquo;">
</form>
<?php include("pages.php") ?>